var should = require('should');
var vipHandler = require('../../../app/servers/user/handler/vipHandler');
var roleModel = require('../../../app/models/roleModel');
var config = require('../../config');

suite('测试vipHandler', function () {
    suite('receiveReward', function () {
        setup(function (done) {
            roleModel.getByRoleId(config.other_role_id, function (err, role_model) {
                role_model.addDiamond(10000);
                role_model.save(done);
            });
        });

        test('领取vip奖励', function (done) {
            var msg = {};
            var session = {};
            session.uid = config.other_role_id;

            var vip_handler = new vipHandler();
            vip_handler.receiveReward(msg, session, function (err, res) {
                done();
            });
        });

        test('领取vip奖励', function (done) {
            var msg = {};
            msg.vip_level = 3;
            var session = {};
            session.uid = config.other_role_id;

            var vip_handler = new vipHandler();
            vip_handler.receiveReward(msg, session, function (err, res) {
                done();
            });
        });

        test('购买vip礼包', function (done) {
            var msg = {};
            msg.property_type = 3000111;
            var session = {};
            session.uid = config.other_role_id;

            var vip_handler = new vipHandler();
            vip_handler.buyVipBox(msg, session, function (err, res) {
                done();
            });
        });
    });
});
